* Variable cleaning that is necessary after the data is merged.


* Load merged data
use "${data_out_folder}/wave1_wave2", clear


* wave indicator
gen wave_2 = wave == 2

* BELIEFS
rename fight_gw_belief_1 belief_behavior
rename fight_gw_belief_2 belief_norm
rename fight_gw_belief_3 belief_punish

la var belief_behavior "Behavior belief"
la var belief_norm "Norms belief"
la var belief_punish "Punishment belief"


* Household income (continuously coded) and log income
replace hh_income = 5000 if hh_income == 1
replace hh_income = 15000 if hh_income == 2
replace hh_income = 25000 if hh_income == 3
replace hh_income = 35000 if hh_income == 4
replace hh_income = 45000 if hh_income == 5
replace hh_income = 55000 if hh_income == 6
replace hh_income = 65000 if hh_income == 7
replace hh_income = 75000 if hh_income == 8
replace hh_income = 85000 if hh_income == 9
replace hh_income = 95000 if hh_income == 10
replace hh_income = 105000 if hh_income == 11
replace hh_income = 115000 if hh_income == 12
replace hh_income = 125000 if hh_income == 13
replace hh_income = 135000 if hh_income == 14
replace hh_income = 145000 if hh_income == 15
replace hh_income = 175000 if hh_income == 16
replace hh_income = 225000 if hh_income == 17
gen log_income = log(hh_income)
la var log_income "Log income"

gen college = educ >= 4
la var college "College degree" 

gen democrat = party == 2
la var democrat "Democrat"

gen employed = job == 1
la var employed "Employed"

gen some_children = children > 0
la var some_children "Parent"

la var age "Age" 
la var female "Female" 
la var region_northeast "Northeast" 
la var region_midwest "Midwest" 
la var region_south "South"

la var relative_universalist_values "Rel. universalism"

* Age squared
gen age_squared = age * age
la var age_squared "Age (squared)"

* Outcome: Donation 
rename donate_atmosfair_4 donation
la var donation "Donation"


gen dem_college = college * democrat
gen rep_college = college * !democrat


* Policy variables
label var support_policy_1 "Fund research into renewable energy"
label var support_policy_2 "Regulate carbon dioxide as a pollutant"
label var support_policy_3 "Set carbox dioxide emission limits"
label var support_policy_4 "Carbon tax"
label var support_policy_5 "Production of at least 20% of eletricity with renewable sources"
label var support_policy_6 "Tax rebates for people who purchase energy-efficient items"

label var support_schools "Schools should teach about GW"

label var support_actions_1 "Vote for candidate that supports GW"
label var support_actions_2 "Display sign about GW"
label var support_actions_3 "Donate money to GW organization"
label var support_actions_4 "Volunteer in GW organization"
label var support_actions_5 "Contact government officials about GW"
label var support_actions_6 "Meet with elected official about GW"
label var support_actions_7 "Support organization engaging in non-violent civil disobedience"
label var support_actions_8 "Engage in non-violent civil disobedience"
label var support_actions_9 "Attend rally/speech/protest"
label var support_actions_10 "Contact the media to express opinion on GW"
label var support_actions_11 "Share info about GW on social media"


label var fight_belief_1 "Restrict meat consumption"
label var fight_belief_2 "Avoid taking flights"
label var fight_belief_3 "Use environmentally-friendly alternatives to car"
label var fight_belief_4 "Receive electricity from green sources"
label var fight_belief_5 "Adapt shopping behavior"
label var fight_belief_6 "Politically support fight against GW"

label var fight_norms_1 "Restrict meat consumption"
label var fight_norms_2 "Avoid taking flights"
label var fight_norms_3 "Use environmentally-friendly alternatives to car"
label var fight_norms_4 "Receive electricity from green sources"
label var fight_norms_5 "Adapt shopping behavior"
label var fight_norms_6 "Politically support fight against GW"

label var fight_norms_belief_1 "Restrict meat consumption"
label var fight_norms_belief_2 "Avoid taking flights"
label var fight_norms_belief_3 "Use environmentally-friendly alternatives to car"
label var fight_norms_belief_4 "Receive electricity from green sources"
label var fight_norms_belief_5 "Adapt shopping behavior"
label var fight_norms_belief_6 "Politically support fight against GW"


* Save results
compress
save "${data_out_folder}/wave1_wave2_final", replace